<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="./css/login.css"/>
    <title>首页</title>
	<script src="js/jquery-3.2.1.min.js"></script>
	<script src="js/common.js"></script>
    <script src="js/login.js"></script> 
</head>
<body>
	<!-- 导航界面 -->
	<nav>
		<div class="nav">
			<span class="lf">终于等到你</span>
			<span class="rt">爱下载资源分享平台</span>
		</div>
	</nav>
	
	<!-- 登录面板 -->
	<section class="main">
		<div class="login-type">
			<a class="checked" name="login-pwd">密码登录</a><a name="login-sms">短信码登录</a>
		</div>
		
		<form class="login-pwd login-panel" autocomplete="off">
			<input type="text" name="username" class="inp user" id="inp-user" placeholder="账号/邮箱/手机号"/>
			<input type="password" name="password" class="inp pwd" id="inp-pwd" placeholder="密码"/>
			<!-- 处理密码眼睛 -->
			<span class="eye clos"></span>
			
			<div class="re">
				<input type="checkbox" name="remember-me" id="remember-me"/>
				<label for="remember-me">下次自动登录</label>
				<a class="find-pass" href="findpass.html">忘记密码，立即找回</a>
			</div>
			
			<a class="log-btn">登录</a>
			
			<a href="register.html" class="regist">没有账号？立即注册</a>
			
			
		</form>
		
		<form class="login-sms login-panel" autocomplete="off">
			<input type="text" name="tel" class="inp tel" placeholder="手机号"/>
			<input type="code" name="code" class="inp code" placeholder="验证码"/>
			<span class="btn-code">获取验证码</span>
			
			<div class="re">
				<input type="checkbox" name="remember-me" id="remember"/>
				<label for="remember">下次自动登录</label>
			</div>
			
			<a class="log-btn">登录</a>
			
			<a href="register.html" class="regist">没有账号？立即注册</a>
			
		</form>
		
		<div class="third">
			<span class="lf"></span>第三方登录<span class="rf"></span>	
		</div>
		
		<p class="third">
			<a class="zfb"><span>支付宝</span></a>
			<a class="wx"><span>微信</span></a>
			<a class="qq"><span>QQ</span></a>
		</p>
		
	</section>
	
	<footer>
		<p class="decro">本站所有资源信息均由网友上传,本站只是为了推广资源让更多读者下载,使用。如涉侵权，请联系管理员</p>
		<p class="cr">Copyright © 2021-2025 <span class="site">爱下载资源分享平台</span> All Rights Reserved.</p>
		<p class="num">沪ICP备14048333号</p>
	</footer>


<script>
	$(document).ready(function (){
		$(".log-btn").click(function(){
			var username = $("#inp-user").val();
			var password = $("#inp-pwd").val();
			$.ajax({
				type:"get",
				url:"loginServlet/login",
				data:{username:username, password:password},
				success:function (data){
					if (data.code == 503){
						location.href = "index.html";
					}else {
						alert(data.msg);
					}
				}
			});
		});
	});
</script>
</body>

</html>